
package Geral;

import entidade.FaleConoco;
import entidade.Usuario;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
import persistencia.BD;
import telasDeCadastros.CadastrarLogin;
import telasDeCadastros.CadastroAluno;
import telasDeCadastros.CadastroCurso;
import telasDeCadastros.CadastroFuncionario;
import telasDeCadastros.CadastroMateria;
import telasDeConsultas.ConsultarAluno;
import telasDeConsultas.ConsultarCurso;
import telasDeConsultas.ConsultarFuncionario;
import telasDeConsultas.ConsultarMateria;

/**
 *
 * @author Suporte
 */
public class Menu extends javax.swing.JFrame {

    private Collection lista;
    public Menu() {
        
        initComponents();
        lista = new ArrayList();
    }
  
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        banner = new javax.swing.JLabel();
        lblMensagem2 = new javax.swing.JLabel();
        lblMensagem = new javax.swing.JLabel();
        lblBemVindo1 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        MenuCadastrar = new javax.swing.JMenu();
        MenuItemCadastrarAluno = new javax.swing.JMenuItem();
        MenuItemCadastrarCurso = new javax.swing.JMenuItem();
        MenuItemCadastrarFuncionario = new javax.swing.JMenuItem();
        MenuItemCadastrarLogin = new javax.swing.JMenuItem();
        MenuItemCadastrarMateria = new javax.swing.JMenuItem();
        MenuManutencao = new javax.swing.JMenu();
        MenuItemManutencaoAluno = new javax.swing.JMenuItem();
        MenuConsultas = new javax.swing.JMenu();
        MenuItemConsultarAluno = new javax.swing.JMenuItem();
        MenuItemConsultarCurso = new javax.swing.JMenuItem();
        MenuItemConsultarFuncionario = new javax.swing.JMenuItem();
        MenuItemConsultarMateria = new javax.swing.JMenuItem();
        MenuAjuda = new javax.swing.JMenu();
        MenuItemSobre = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMaximizedBounds(new java.awt.Rectangle(0, 0, 706, 740));
        setResizable(false);

        banner.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Geral/banner.jpg"))); // NOI18N
        banner.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 204, 255), 2, true));
        banner.setMaximumSize(new java.awt.Dimension(720, 187));
        banner.setMinimumSize(new java.awt.Dimension(720, 187));

        lblMensagem2.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        lblMensagem2.setForeground(new java.awt.Color(255, 0, 51));
        lblMensagem2.setText("Clique Aqui!!!");
        lblMensagem2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblMensagem2MouseClicked(evt);
            }
        });

        lblMensagem.setFont(new java.awt.Font("Tahoma", 0, 36));

        lblBemVindo1.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N
        lblBemVindo1.setText("Seja Bem vindo(a) ");

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        jLabel1.setText("Ler Mensagens do Site");

        jMenuBar1.setBackground(new java.awt.Color(0, 204, 255));

        MenuCadastrar.setBackground(new java.awt.Color(0, 204, 255));
        MenuCadastrar.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 2, true));
        MenuCadastrar.setText("Cadastrar");
        MenuCadastrar.setAlignmentX(0.1F);
        MenuCadastrar.setAlignmentY(0.1F);
        MenuCadastrar.setAutoscrolls(true);
        MenuCadastrar.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        MenuCadastrar.setFont(new java.awt.Font("Tahoma", 1, 11));
        MenuCadastrar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        MenuCadastrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuCadastrarActionPerformed(evt);
            }
        });

        MenuItemCadastrarAluno.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        MenuItemCadastrarAluno.setBackground(new java.awt.Color(204, 204, 204));
        MenuItemCadastrarAluno.setText("Alunos");
        MenuItemCadastrarAluno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemCadastrarAlunoActionPerformed(evt);
            }
        });
        MenuCadastrar.add(MenuItemCadastrarAluno);

        MenuItemCadastrarCurso.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        MenuItemCadastrarCurso.setBackground(new java.awt.Color(204, 204, 204));
        MenuItemCadastrarCurso.setText("Cursos");
        MenuItemCadastrarCurso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemCadastrarCursoActionPerformed(evt);
            }
        });
        MenuCadastrar.add(MenuItemCadastrarCurso);

        MenuItemCadastrarFuncionario.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
        MenuItemCadastrarFuncionario.setBackground(new java.awt.Color(204, 204, 204));
        MenuItemCadastrarFuncionario.setText("Funcionários");
        MenuItemCadastrarFuncionario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemCadastrarFuncionarioActionPerformed(evt);
            }
        });
        MenuCadastrar.add(MenuItemCadastrarFuncionario);

        MenuItemCadastrarLogin.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.CTRL_MASK));
        MenuItemCadastrarLogin.setBackground(new java.awt.Color(204, 204, 204));
        MenuItemCadastrarLogin.setText("Login/Senha");
        MenuItemCadastrarLogin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemCadastrarLoginActionPerformed(evt);
            }
        });
        MenuCadastrar.add(MenuItemCadastrarLogin);

        MenuItemCadastrarMateria.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.CTRL_MASK));
        MenuItemCadastrarMateria.setBackground(new java.awt.Color(204, 204, 204));
        MenuItemCadastrarMateria.setText("Matérias");
        MenuItemCadastrarMateria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemCadastrarMateriaActionPerformed(evt);
            }
        });
        MenuCadastrar.add(MenuItemCadastrarMateria);

        jMenuBar1.add(MenuCadastrar);

        MenuManutencao.setBackground(new java.awt.Color(0, 204, 255));
        MenuManutencao.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 2, true));
        MenuManutencao.setText("Notas/Alunos");
        MenuManutencao.setAlignmentX(0.1F);
        MenuManutencao.setAlignmentY(0.1F);
        MenuManutencao.setFont(new java.awt.Font("Tahoma", 1, 11));

        MenuItemManutencaoAluno.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, java.awt.event.InputEvent.CTRL_MASK));
        MenuItemManutencaoAluno.setBackground(new java.awt.Color(204, 204, 204));
        MenuItemManutencaoAluno.setText("Manutenção de Alunos");
        MenuItemManutencaoAluno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemManutencaoAlunoActionPerformed(evt);
            }
        });
        MenuManutencao.add(MenuItemManutencaoAluno);

        jMenuBar1.add(MenuManutencao);

        MenuConsultas.setBackground(new java.awt.Color(0, 204, 255));
        MenuConsultas.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 2, true));
        MenuConsultas.setText("Consultas");
        MenuConsultas.setAlignmentX(0.1F);
        MenuConsultas.setAlignmentY(0.1F);
        MenuConsultas.setFont(new java.awt.Font("Tahoma", 1, 11));

        MenuItemConsultarAluno.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F2, java.awt.event.InputEvent.CTRL_MASK));
        MenuItemConsultarAluno.setBackground(new java.awt.Color(204, 204, 204));
        MenuItemConsultarAluno.setText("Alunos");
        MenuItemConsultarAluno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemConsultarAlunoActionPerformed(evt);
            }
        });
        MenuConsultas.add(MenuItemConsultarAluno);

        MenuItemConsultarCurso.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.CTRL_MASK));
        MenuItemConsultarCurso.setBackground(new java.awt.Color(204, 204, 204));
        MenuItemConsultarCurso.setText("Curso");
        MenuItemConsultarCurso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemConsultarCursoActionPerformed(evt);
            }
        });
        MenuConsultas.add(MenuItemConsultarCurso);

        MenuItemConsultarFuncionario.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F3, java.awt.event.InputEvent.CTRL_MASK));
        MenuItemConsultarFuncionario.setBackground(new java.awt.Color(204, 204, 204));
        MenuItemConsultarFuncionario.setText("Funcionários");
        MenuItemConsultarFuncionario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemConsultarFuncionarioActionPerformed(evt);
            }
        });
        MenuConsultas.add(MenuItemConsultarFuncionario);

        MenuItemConsultarMateria.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, java.awt.event.InputEvent.CTRL_MASK));
        MenuItemConsultarMateria.setBackground(new java.awt.Color(204, 204, 204));
        MenuItemConsultarMateria.setText("Matéria");
        MenuItemConsultarMateria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemConsultarMateriaActionPerformed(evt);
            }
        });
        MenuConsultas.add(MenuItemConsultarMateria);

        jMenuBar1.add(MenuConsultas);

        MenuAjuda.setBackground(new java.awt.Color(0, 204, 255));
        MenuAjuda.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 204, 204), 2, true));
        MenuAjuda.setText("Ajuda");
        MenuAjuda.setAlignmentX(0.1F);
        MenuAjuda.setFont(new java.awt.Font("Tahoma", 1, 11));

        MenuItemSobre.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        MenuItemSobre.setBackground(new java.awt.Color(204, 204, 204));
        MenuItemSobre.setText("Sobre");
        MenuItemSobre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                MenuItemSobreActionPerformed(evt);
            }
        });
        MenuAjuda.add(MenuItemSobre);

        jMenuBar1.add(MenuAjuda);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(banner, javax.swing.GroupLayout.PREFERRED_SIZE, 710, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(682, Short.MAX_VALUE)
                .addComponent(lblMensagem, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(29, 29, 29))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(154, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(lblBemVindo1)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 273, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblMensagem2, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(151, 151, 151))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(banner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(lblBemVindo1, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(13, 13, 13)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblMensagem2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 294, Short.MAX_VALUE)
                .addComponent(lblMensagem, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(24, 24, 24))
        );

        setBounds(150, 0, 718, 740);
    }// </editor-fold>//GEN-END:initComponents

    private void MenuItemCadastrarCursoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemCadastrarCursoActionPerformed

        CadastroCurso curso = new CadastroCurso();
        curso.setVisible(true);
        this.dispose();

    }//GEN-LAST:event_MenuItemCadastrarCursoActionPerformed

    private void MenuItemCadastrarMateriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemCadastrarMateriaActionPerformed

        CadastroMateria materia = new CadastroMateria();
        materia.setVisible(true);
        this.dispose();

    }//GEN-LAST:event_MenuItemCadastrarMateriaActionPerformed

    private void MenuItemCadastrarFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemCadastrarFuncionarioActionPerformed

        CadastroFuncionario funcionario = new CadastroFuncionario();
        funcionario.setVisible(true);
        this.dispose();

    }//GEN-LAST:event_MenuItemCadastrarFuncionarioActionPerformed

    private void MenuItemCadastrarAlunoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemCadastrarAlunoActionPerformed

        CadastroAluno aluno = new CadastroAluno();
        aluno.setVisible(true);
        this.dispose();
    }//GEN-LAST:event_MenuItemCadastrarAlunoActionPerformed

    private void MenuItemManutencaoAlunoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemManutencaoAlunoActionPerformed

        ManutencaoAluno manutencao = new ManutencaoAluno();
        manutencao.setVisible(true);
        this.dispose();

    }//GEN-LAST:event_MenuItemManutencaoAlunoActionPerformed

    private void MenuItemConsultarAlunoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemConsultarAlunoActionPerformed

        ConsultarAluno aluno = new ConsultarAluno();
        aluno.setVisible(true);
        this.dispose();
    }//GEN-LAST:event_MenuItemConsultarAlunoActionPerformed

    private void MenuItemConsultarFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemConsultarFuncionarioActionPerformed

        ConsultarFuncionario funcionario = new ConsultarFuncionario();
        funcionario.setVisible(true);
        this.dispose();

    }//GEN-LAST:event_MenuItemConsultarFuncionarioActionPerformed

    private void MenuItemSobreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemSobreActionPerformed

        Sobre sobre = new Sobre();
        sobre.setVisible(true);


    }//GEN-LAST:event_MenuItemSobreActionPerformed

    private void MenuItemConsultarCursoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemConsultarCursoActionPerformed

        ConsultarCurso curso = new ConsultarCurso();
        curso.setVisible(true);
        this.dispose();

    }//GEN-LAST:event_MenuItemConsultarCursoActionPerformed

    private void MenuItemConsultarMateriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemConsultarMateriaActionPerformed

        ConsultarMateria materia = new ConsultarMateria();
        materia.setVisible(true);
        this.dispose();

    }//GEN-LAST:event_MenuItemConsultarMateriaActionPerformed

    private void MenuItemCadastrarLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuItemCadastrarLoginActionPerformed

        CadastrarLogin login = new CadastrarLogin();
        login.setVisible(true);

    }//GEN-LAST:event_MenuItemCadastrarLoginActionPerformed

    private void lblMensagem2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblMensagem2MouseClicked

        ListaDeMensagens mensagem = new ListaDeMensagens();
        mensagem.setVisible(true);
        try {
            mensagem.iniciar();
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Menu.class.getName()).log(Level.SEVERE, null, ex);
        }
        this.dispose();
        

    }//GEN-LAST:event_lblMensagem2MouseClicked

    private void MenuCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_MenuCadastrarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_MenuCadastrarActionPerformed

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Menu().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu MenuAjuda;
    private javax.swing.JMenu MenuCadastrar;
    private javax.swing.JMenu MenuConsultas;
    private javax.swing.JMenuItem MenuItemCadastrarAluno;
    private javax.swing.JMenuItem MenuItemCadastrarCurso;
    private javax.swing.JMenuItem MenuItemCadastrarFuncionario;
    private javax.swing.JMenuItem MenuItemCadastrarLogin;
    private javax.swing.JMenuItem MenuItemCadastrarMateria;
    private javax.swing.JMenuItem MenuItemConsultarAluno;
    private javax.swing.JMenuItem MenuItemConsultarCurso;
    private javax.swing.JMenuItem MenuItemConsultarFuncionario;
    private javax.swing.JMenuItem MenuItemConsultarMateria;
    private javax.swing.JMenuItem MenuItemManutencaoAluno;
    private javax.swing.JMenuItem MenuItemSobre;
    private javax.swing.JMenu MenuManutencao;
    private javax.swing.JLabel banner;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JLabel lblBemVindo1;
    private javax.swing.JLabel lblMensagem;
    private javax.swing.JLabel lblMensagem2;
    // End of variables declaration//GEN-END:variables

    public void inicializar(Usuario u) {
        this.setVisible(true);
        

       /*
       FaleConoco fale = new FaleConoco();
       BD bdados = new BD();
       String sql = "select * from faleconosco where indicador = 1";

        ArrayList mensagens = new ArrayList();

        ResultSet res;
        bdados.consultar(sql);

        while(res.next()){
            mensagens.add(res.get);
        }

        if(mensagens.size() > 0){
            lblMensagem2.setText("Você tem uma nova mensagem");
        }
        * 
        */
    }

}
